<?
class indexController extends iMVC_Controller{


    public function index(){
        //print_r($this->get);
        $this->assign("name","dull");
        $this->assign("baseUrl",$this->getBaseUrl());
        $this->display("index.tpl");
        $vt=new iMVC_Validator($this->request);
        $abc=11111;
        //addRule第二个参数需外层为'
        $vt->addRule('name','{"requried":true,"email":true,"max-length":1,"min-length":1,"regRule":"/.*/"}','{"requried":"requried错误","email":"email格式不正确"}');
        $vt->addRule('pass','{"requried":true,"equalTo":'.$abc.',"max-length":1,"min-length":1,"regRule":"/^2.*/"}','{"default":"出现错误","regRule":"正则错误"}');
        //echo "<br>";
        //var_dump($vt->validate());
        //echo "<br>";
        //print_r($vt->getErrorList());

    }
    //重写父类的before函数,在controller执行前可做验证
    protected function before(){
    
    
    }

}
